
/**
 * @file    WebStream.h
 * @brief   
 * @date    2004-12-29 15:55:23
 * @author  GengYong (gengyong@gmail.com)
 *
 */

#ifndef WEBWINDOW_HEADER_WEBSTREAM_H
#define WEBWINDOW_HEADER_WEBSTREAM_H
//----------------------------------------------------------

#include "WebWindowImpl.h"

namespace xessage_private {
	class WebStream: public IStream
	{
	public:
		WebStream(WebWindowImpl * app);
		virtual ~WebStream();
	public:
		virtual	HRESULT	STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject);
		virtual ULONG	STDMETHODCALLTYPE AddRef();
		virtual ULONG	STDMETHODCALLTYPE Release();
		virtual HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead);
		virtual HRESULT STDMETHODCALLTYPE Write(const void *pv, ULONG cb, ULONG *pcbWritten);
		virtual HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
		virtual HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize);
		virtual HRESULT STDMETHODCALLTYPE CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
		virtual HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags);
		virtual HRESULT STDMETHODCALLTYPE Revert(VOID);
		virtual HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
		virtual HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
		virtual HRESULT STDMETHODCALLTYPE Stat(STATSTG *pstatstg, DWORD grfStatFlag);
		virtual HRESULT STDMETHODCALLTYPE Clone(IStream **ppstm);
	private:
		WebWindowImpl *	m_appImpl;
		LONG			m_refCount;
	};
}

//----------------------------------------------------------
#endif	//ifndef WEBWINDOW_HEADER_WEBSTREAM_H